﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace JewererBasic.BO
{
    public class GammaBO
    {
        static MSQDBEntities db = new MSQDBEntities();        

        public static List<GAMMA> Gammas()
        {
            return db.GAMMAs.ToList();
        }

        public static int GetId(string name)
        {
            var query = (from d in db.GAMMAs
                         where d.Name.Equals(name)
                         select d).ToList();
            if (query.Count == 1)
                return query.First().Id;
            throw new NullReferenceException("Can't find Gamma: " + name);
        }
    }
}